﻿#include<iostream>
using namespace std;

int main()
{
	//左值可以取地址
	int* p = new int(0);
	int b = 1;
	const int c = b;
	*p = 1;
	string s(" 111");
	s[0] = 'x';

	cout << &c << endl;
	cout << (void*)&s[0] << endl;

	//右值不能取地址
	double x = 1.1,y = 2.2;
	//以下常见的右值
	10;

	x + y;

	fmin(x, y);

	string("ccsdcc");

	// 左值引⽤不能直接引⽤右值，但是const左值引⽤可以引⽤右值
	const int& rx1 = 10;
	const double& rx2 = x + y;
	const double& rx3 = fmin(x, y);
	const string& rx4 = string("11111");

	// b、r1、rr1都是变量表达式，都是左值
	/*cout << &b << endl;
	cout << &r1 << endl;
	cout << &rr1 << endl;*/





	return 0;
}